#ifndef __AgentFactoryI_H__
#define __AgentFactoryI_H__

#include <FIPA.h>
#include <AgentI.h>

#include <Ice/Ice.h>
#include <IceUtil/UUID.h>
#include <IceUtil/Mutex.h>
#include <map>

using namespace std;

class AgentFactoryI: public FIPA::AgentFactory
{
 public:
  AgentFactoryI();
  ~AgentFactoryI();

  virtual FIPA::AgentPrx create
    (const std::string&, 
     const Ice::Current&);
  virtual FIPA::AgentSeq createSeq
    (const Ice::StringSeq&, 
     Ice::StringSeq&,
     const ::Ice::Current&);

 private:
  IceUtil::Mutex _m;
  typedef std::map
    <Ice::Identity, AgentIPtr>
    RMap;
  mutable RMap _agents;
};

typedef IceUtil::Handle<AgentFactoryI> AgentFactoryIPtr;

#endif
